package com.example.android3;

import android.annotation.SuppressLint;
import android.os.Bundle;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import android.view.View;
import android.widget.Button;
public class MainActivity extends AppCompatActivity  implements View.OnClickListener{
private Button btn_one,btn_two,btn_three;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_main);
        btn_one=findViewById(R.id.btn_one);
        btn_two=findViewById(R.id.btn_two);
        btn_three=findViewById(R.id.btn_three);

        btn_one.setOnClickListener(new View.OnClickListener(){
            public void onClick(View view){
                btn_one.setText("按钮1已被点击");
            }
        });
        btn_three.setOnClickListener(this);
    }
public void click(View view){
    btn_two.setText("按钮2已被点击");
}
@Override
public void onClick(View v){
        btn_three.setText("按钮三被点击");
}
}